clearvars -except b
load est_res_s2 rentd  M con_m 
load datafromstata gamma

statmwtp = rentd;

picmwtp = 0*rentd;
for m = 1:M
    index = find(con_m==m);
    picmwtp(index) = statmwtp(index)/gamma(m);
end

%%%
res1 = [mean(statmwtp) mean(picmwtp)];

for m = 1:M
    index = find(con_m==m);
    res2(m,:) = [mean(statmwtp(index)) mean(picmwtp(index))];
    ob(m) = length(index);
end

%%%
res2;

imp_bias = 100*(res2(:,1)-res2(:,2))./res2(:,2);

save bias_comp res1 res2 imp_bias